<template>
  <div class="app-container">
    <el-card class="box-card">
    <el-form :model="queryParams" ref="queryForm" size="small" :inline="true"  label-width="42px">
      <el-form-item label="栏目" prop="contentColumn">
        <el-select
          v-model="queryParams.contentColumn"
          placeholder="请选择栏目"
          clearable
        >
          <el-option
            v-for="dict in dict.type.think"
            :key="dict.value"
            :label="dict.label"
            :value="dict.value"
          />
        </el-select>
      </el-form-item>
      <el-form-item label="标题" prop="noticeTitle" label-width="42px">
        <el-input
          v-model="queryParams.noticeTitle"
          placeholder="请输入思想政治标题"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <!--<el-form-item label="图片路径" prop="pictureUrl">
        <el-input
          v-model="queryParams.pictureUrl"
          placeholder="请输入图片路径"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="材料路径" prop="sourcesUrl">
        <el-input
          v-model="queryParams.sourcesUrl"
          placeholder="请输入材料路径"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>-->
      <el-form-item label="创建时间" prop="createTime" label-width="68px">
        <el-date-picker clearable
                        v-model="queryParams.createTime"
                        type="date"
                        value-format="yyyy-MM-dd"
                        placeholder="请选择思想政治创建时间">
        </el-date-picker>
      </el-form-item>
    <!--  <el-form-item label="参与人员" prop="participants"  >
        <el-input
          v-model="queryParams.participants"
          placeholder="请输入思想政治参与人员"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>-->

      <!--<el-form-item label="创建者" prop="createBy" v-show="showSearch">
        <el-input
          v-model="queryParams.createBy"
          placeholder="请输入创建者"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="创建时间" prop="createTime" v-show="showSearch">
        <el-date-picker clearable
          v-model="queryParams.createTime"
          type="date"
          value-format="yyyy-MM-dd"
          placeholder="请选择创建时间">
        </el-date-picker>
      </el-form-item>
      <el-form-item label="更新者" prop="updateBy" v-show="showSearch">
        <el-input
          v-model="queryParams.updateBy"
          placeholder="请输入更新者"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="更新时间" prop="updateTime" v-show="showSearch">
        <el-date-picker clearable
          v-model="queryParams.updateTime"
          type="date"
          value-format="yyyy-MM-dd"
          placeholder="请选择更新时间">
        </el-date-picker>
      </el-form-item>-->
      <br/>
      <div style="text-align:right;">

          <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
          <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>

      </div>
      <br/>
    </el-form>

    <el-row :gutter="10" class="mb8">
      <el-col :span="1.5">
        <el-button
          type="primary"
          plain
          icon="el-icon-plus"
          size="mini"
          @click="handleAdd"
          v-hasPermi="['gs:thought:add']"
        >新增</el-button>
      </el-col>
      <!--<el-col :span="1.5">
        <el-button
          type="success"
          plain
          icon="el-icon-edit"
          size="mini"
          :disabled="single"
          @click="handleUpdate"
          v-hasPermi="['gs:thought:edit']"
        >修改</el-button>
      </el-col>-->
      <el-col :span="1.5">
        <el-button
          type="danger"
          plain
          icon="el-icon-delete"
          size="mini"
          :disabled="multiple"
          @click="handleDelete"
          v-hasPermi="['gs:thought:remove']"
        >删除</el-button>
      </el-col>
      <el-col :span="1.5">
        <el-button
          type="warning"
          plain
          icon="el-icon-download"
          size="mini"
          @click="handleExport"
          v-hasPermi="['gs:thought:export']"
        >导出</el-button>
      </el-col>
     <!-- <el-col :span="1.5">
        <el-button
          type="primary"
          plain
          icon="el-icon-download"
          size="mini"
          @click="takePhotop"
          v-hasPermi="['gs:thought:takePhoto']"
        >拍照</el-button>
      </el-col>-->
     <!-- <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>-->
    </el-row>

    <el-table v-loading="loading" :data="contentList" border @selection-change="handleSelectionChange">
      <el-table-column type="selection" width="55" align="center" />
      <el-table-column type="index" label="序号"  width="55" :index="indexMethod" align="center"/>
      <!--<el-table-column label="类别" align="center" prop="noticeType" />-->
      <el-table-column label="栏目" width="300px" align="center" prop="contentColumn">
        <template slot-scope="scope">
          <dict-tag :options="dict.type.think" :value="scope.row.contentColumn"/>
        </template>
      </el-table-column>
      <el-table-column label="标题" width="300px" align="center" prop="noticeTitle"  />

      <el-table-column label="创建时间" align="center" prop="createTime">
        <template slot-scope="scope">
          <span>{{ parseTime(scope.row.createTime, '{y}-{m}-{d}') }}</span>
        </template>
      </el-table-column>
      <el-table-column label="操作" align="center" class-name="small-padding fixed-width" width="160" fixed="right">
        <template slot-scope="scope">
          <el-button
            size="mini"
            type="text"

            @click="handleUpdate(scope.row)"
            v-hasPermi="['gs:thought:edit']"
          >修改</el-button>
          <el-button
            size="mini"
            type="text"

            @click="handleDelete(scope.row)"
            v-hasPermi="['gs:thought:remove']"
          >删除</el-button>
          <el-button
            size="mini"
            type="text"

            @click="handlelook(scope.row)"

          >详情</el-button>
        </template>
      </el-table-column>
    </el-table>

    <pagination
      v-show="total>0"
      :total="total"
      :page.sync="queryParams.pageNum"
      :limit.sync="queryParams.pageSize"
      @pagination="getList"
    />

    <!-- 添加或修改内容发布对话框 -->
    <el-dialog :title="title" :visible.sync="open" width="1000px" append-to-body>
      <el-form ref="form" :model="form" :rules="rules" label-width="100px">
        <el-container>
        <!--  <el-header>
           <el-divider content-position="left">
              <p style="color: #00afff; font-size: 20px;">思想政治基本信息
              </p>
            </el-divider>
          </el-header>-->
          <el-main>
            <el-row>
              <el-col span="12" style="display: none">
                <el-form-item label="类型" prop="noticeType">
                  <el-input v-model="form.noticeType='1'"></el-input>

                </el-form-item>
              </el-col>
              <el-col span="12">
                <el-form-item label="栏目" prop="contentColumn">
                  <el-select
                    v-model="form.contentColumn"
                    placeholder="请输入栏目名"
                    clearable
                    style="width: 360px"
                  >
                    <el-option
                      v-for="dict in dict.type.think"
                      :key="dict.value"
                      :label="dict.label"
                      :value="dict.value"/>
                  </el-select>

                </el-form-item>
              </el-col>
              <el-col span="12">
                <el-form-item label="标题" prop="noticeTitle">
                  <el-input v-model="form.noticeTitle" placeholder="请输入标题" />

                </el-form-item>
              </el-col>
            </el-row>
            <el-form-item label="内容">
              <editor v-model="form.noticeContent" :min-height="192" placeholder="请输入内容"/>

            </el-form-item>


            <el-row>
             <!-- <el-col span="12">

          <el-form-item label="资料路径" prop="note1">
            <file-upload v-model="form.note1"/>
          </el-form-item>
              </el-col>-->
             <!-- <el-col span="12">-->
          <!--  <el-form-item label="图片路径" prop="note2">
              <image-upload v-model="form.note2"/>

            </el-form-item>-->
             <!-- </el-col>-->
            </el-row>
           <!-- &lt;!&ndash; 文件目录树 &ndash;&gt;
            <el-tree
              :data="fileTree"
              :props="{
					children: 'children',
					label: 'label'
				}"
              :highlight-current="true"
              :expand-on-click-node="false"
              :default-expanded-keys="defaultExpandedKeys"
              node-key="id"
              v-loading="loading"

            >

            </el-tree>-->
         <el-row>
             <!-- <el-col span="12">
                <el-form-item label="创建时间" prop="releaseTime">
                  <el-date-picker clearable
                                  v-model="form.releaseTime"
                                  type="date"
                                  value-format="yyyy-MM-dd"
                                  placeholder="请选择创建时间"
                                  style="float:left;width: 360.01px">
                  </el-date-picker>

                </el-form-item>
              </el-col>-->
              <el-col :span="12">
                <el-form-item label="状态" prop="noticeStatus" >

                  <el-select
                    v-model="form.noticeStatus"
                    placeholder="状态"
                    clearable
                    style="width: 360px"
                  >
                    <el-option
                      v-for="dict in dict.type.yh_notice_status"
                      :key="dict.value"
                      :label="dict.label"
                      :value="dict.value"/>
                  </el-select>
                </el-form-item>
              </el-col>
            </el-row>


            <!--  <el-form-item label="参与人员" prop="participants">
                <el-input v-model="form.participants" placeholder="请输入参与人员" />
              </el-form-item>
              <el-form-item label="浏览次数" prop="viewsTimes">
                <el-input v-model="form.viewsTimes" placeholder="请输入浏览次数" />
              </el-form-item>
              <el-form-item label="备注" prop="remark">
                <el-input v-model="form.remark" type="textarea" placeholder="请输入内容" />
              </el-form-item>-->
            <!-- <el-form-item label="备注1" prop="note1">
               <el-input v-model="form.note1" type="textarea" placeholder="请输入内容" />
             </el-form-item>
             <el-form-item label="备注2" prop="note2">
               <el-input v-model="form.note2" type="textarea" placeholder="请输入内容" />
             </el-form-item>
             <el-form-item label="备注3" prop="note3">
               <el-input v-model="form.note3" type="textarea" placeholder="请输入内容" />
             </el-form-item>
             <el-form-item label="备注4" prop="note4">
               <el-input v-model="form.note4" type="textarea" placeholder="请输入内容" />
             </el-form-item>
             <el-form-item label="备注5" prop="note5">
               <el-input v-model="form.note5" type="textarea" placeholder="请输入内容" />
             </el-form-item>
             <el-form-item label="备注6" prop="note6">
               <el-input v-model="form.note6" type="textarea" placeholder="请输入内容" />
             </el-form-item>
             <el-form-item label="备注7" prop="note7">
               <el-input v-model="form.note7" type="textarea" placeholder="请输入内容" />
             </el-form-item>
             <el-form-item label="备注8" prop="note8">
               <el-input v-model="form.note8" type="textarea" placeholder="请输入内容" />
             </el-form-item>
             <el-form-item label="备注9" prop="note9">
               <el-input v-model="form.note9" type="textarea" placeholder="请输入内容" />
             </el-form-item>
             <el-form-item label="备注10" prop="note10">
               <el-input v-model="form.note10" type="textarea" placeholder="请输入内容" />
             </el-form-item>-->
          </el-main>
        </el-container>
      </el-form>

      <div slot="footer" class="dialog-footer">
        <el-button type="primary" @click="submitForm">确 定</el-button>
        <el-button @click="cancel">取 消</el-button>
      </div>
    </el-dialog>
   <!-- &lt;!&ndash; 详情对话框 &ndash;&gt;
    <el-dialog :title="takephoto.title"  :visible.sync="takephoto.open" width="80%" append-to-body>
      <template>

        <div class="app-container" >
          <div style="width:85%; height: 100%;   border: 1px solid white; float:left">





            <div>
              <el-form ref="elForm" :model="formData"  size="mini" label-width="95px">
                <el-row :gutter="25">
                  <el-col :span="4">
                    <el-form-item label=" 裁切模式" prop="field108">
                      <el-select  @change="SetCameraCutMode" v-model="formData.field108" placeholder="请选择 裁切模式:" clearable :style="{width: '100%'}">
                        <el-option  v-for="(item, index) in field108Options"  :key="index" :label="item.label" :id="item.id"
                                    :value="item.value" :disabled="item.disabled"></el-option>
                      </el-select>
                    </el-form-item>
                  </el-col>
                  <el-col :span="4">
                    <el-form-item label="文件格式" prop="field109">
                      <el-select @change = "toSetFileType"  v-model="formData.field109" placeholder="请选择文件格式:" id="FileType" clearable :style="{width: '100%'}">
                        <el-option v-for="(item, index) in field109Options" :key="index" :label="item.label"
                                   :value="item.value" :disabled="item.disabled"></el-option>
                      </el-select>
                    </el-form-item>
                  </el-col>
                  <el-col :span="4">
                    <el-form-item label="色彩模式" prop="field120">
                      <el-select id="ColorMode" @change = "toSetColorModel"  v-model="formData.field120" placeholder="请选择色彩模式:" clearable :style="{width: '100%'}">
                        <el-option v-for="(item, index) in field120Options" :key="index" :label="item.label"
                                   :value="item.value" :disabled="item.disabled"></el-option>
                      </el-select>
                    </el-form-item>
                  </el-col>
                  <el-col :span="4">
                    <el-form-item label="图像质量" prop="field121">
                      <el-select id="JpgQuality" @change = "toSetJpgQuality" v-model="formData.field121" placeholder="请选择图像质量:" clearable :style="{width: '100%'}">
                        <el-option v-for="(item, index) in field121Options" :key="index" :label="item.label"
                                   :value="item.value" :disabled="item.disabled"></el-option>
                      </el-select>
                    </el-form-item>
                  </el-col>
                  <el-col :span="4">
                    <el-form-item label="DPI" prop="field122">
                      <el-select   id="DPI"  @change = "toSetDPI" v-model="formData.field122" placeholder="请选择DPI:" clearable :style="{width: '100%'}">
                        <el-option v-for="(item, index) in field122Options" :key="index" :label="item.label"
                                   :value="item.value" :disabled="item.disabled"></el-option>
                      </el-select>
                    </el-form-item>
                  </el-col>
                  &lt;!&ndash;<el-col :span="4"  style="visibility:hidden">
                    <el-form-item label="DPI:" prop="field122">
                      <el-select v-model="formData.field122" placeholder="请选择DPI:" clearable :style="{width: '100%'}">
                        <el-option v-for="(item, index) in field122Options" :key="index" :label="item.label"
                                   :value="item.value" :disabled="item.disabled"></el-option>
                      </el-select>
                    </el-form-item>
                  </el-col>&ndash;&gt;

                  <el-col :span="4">
                    <el-form-item id="Checkbox3" label="添加水印" prop="field123">
                      <el-checkbox-group v-model="formData.field123" size="medium">
                        <el-checkbox v-for="(item, index) in field123Options" :key="index" :label="item.value"
                                     :disabled="item.disabled">{{item.label}}</el-checkbox>
                      </el-checkbox-group>
                    </el-form-item>
                  </el-col>
                  <el-col :span="4">

                    <el-form-item id="Select2" label="水印颜色" prop="field128">
                      <el-select v-model="formData.field128" placeholder="请选择颜色" clearable :style="{width: '100%'}">
                        <el-option v-for="(item, index) in field128Options" :key="index" :label="item.label"
                                   :value="item.value" :disabled="item.disabled"></el-option>
                      </el-select>
                    </el-form-item>
                  </el-col>





















                  <el-col :span="4">
                    <el-form-item id="Text1q" label="水印内容" prop="field124">
                      <el-input v-model="formData.field124" placeholder="请输入水印内容" clearable :style="{width: '100%'}">
                      </el-input>
                    </el-form-item>
                  </el-col>
                  <el-col :span="4">
                    <el-form-item id="Text2" label="水印透明度" prop="field125">
                      <el-input v-model="formData.field125" placeholder="请输入透明度" clearable :style="{width: '100%'}">
                      </el-input>
                    </el-form-item>
                  </el-col>
                  <el-col :span="4">
                    <el-form-item id="Text3" label="水印大小" prop="field126">
                      <el-input v-model="formData.field126" placeholder="请输入大小" clearable :style="{width: '100%'}">
                      </el-input>
                    </el-form-item>
                  </el-col>
                  <el-col :span="4">
                    <el-form-item id="Select1" label="水印位置" prop="field127">
                      <el-select v-model="formData.field127" placeholder="请选择位置" clearable :style="{width: '100%'}">
                        <el-option v-for="(item, index) in field127Options" :key="index" :label="item.label"
                                   :value="item.value" :disabled="item.disabled"></el-option>
                      </el-select>
                    </el-form-item>
                  </el-col>
                  <el-col :span="4">
                    <el-form-item id="Checkbox4" label-width="100px" label="添加时间水印  " prop="field111">
                      <el-checkbox-group v-model="formData.field129" size="medium">
                        <el-checkbox v-for="(item, index) in field129Options" :key="index" :label="item.value"
                                     :disabled="item.disabled">{{item.label}}</el-checkbox>
                      </el-checkbox-group>
                    </el-form-item>
                  </el-col>



                </el-row>

              </el-form>
              <el-button plain @click = "toSetWaterMarkParams()">生效水印参数设置</el-button>
              <el-button plain @click = "Cam_ZoomIna()">放大</el-button>

              <el-button plain  @click = "Cam_ZoomOuta()" >缩小</el-button>
              <el-button plain  @click = "Cam_BestSizea()" >适屏</el-button>
              <el-button plain  @click = "Cam_TrueSizea()" >1:1</el-button>
              <el-button plain  @click = "Cam_RotateLefta()" >左旋</el-button>
              <el-button plain  @click = "Cam_RotateRighta()" >右旋</el-button>
              &lt;!&ndash;  <el-button plain  @click = "TakePhoto()" >拍照</el-button>&ndash;&gt;
              &lt;!&ndash;<el-button plain  @click = "Cam_Focus()" >对焦</el-button>&ndash;&gt;
              <el-button plain  @click = "Cam_ShowVideoPropa()" >设置</el-button>
              &lt;!&ndash;<el-button plain  @click = "HttpUploadFile()" >上传</el-button>&ndash;&gt;

              <el-button plain  @click = "ToAddPDFFile()" >添加合并PDF文件</el-button>
              <el-button plain  @click = "ToCombinePDF()" >合并PDF</el-button>
              &lt;!&ndash; <el-button plain  @click = "ToAddMergeImageFile()" >添加合并图像文件</el-button>&ndash;&gt;
              &lt;!&ndash;  <el-button plain  @click = "ToMergeImages()" >合并图像</el-button>&ndash;&gt;
              <el-button plain  @click = "ToDeleteFile()" >删除</el-button>
              &lt;!&ndash;<el-button plain  @click = "LoadCameraDocument()" >删除4</el-button>&ndash;&gt;
            </div>
            <br>

            <div style="background-color:#f8f8f9;border: 1px solid white;margin-top: 5px;" >

              <div  id='CameraCtl' style="width: 650px; height:400px;margin:10px auto;">  </div>



              <br />
              <div style="text-align: center">
                &lt;!&ndash; 设备
                 <el-select v-model="value" placeholder="请选择">
                   <el-option
                     v-for="item in options"
                     :key="item.value"
                     :label="item.label"
                     :value="item.value"
                   onchange="SelectDevice()">
                   </el-option>
                 </el-select>
                 分辨率
                 <el-select v-model="value" placeholder="请选择">
                   <el-option
                     v-for="item in options"
                     :key="item.value"
                     :label="item.label"
                     :value="item.value"
                     onchange="SelectDevice()">
                   </el-option>
                 </el-select>&ndash;&gt;
                <a style="
    vertical-align: middle;

    font-size: 14px;
    color: #606266;
    line-height: 40px;

    -webkit-box-sizing: border-box;
    box-sizing: border-box;
font-weight: bold;
">设备</a>  &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                &lt;!&ndash;<el-select id="DevName" @click = "SelectDevice()"   clearable >

                </el-select>&ndash;&gt;
                &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                <select style="    height: 28px;
    line-height: 28px;width: 150px;
    " id="DevName"  @click = "SelectDevice()"></select>
                <span v-html="'\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0'"/>
                <a style="
    vertical-align: middle;

    font-size: 14px;
    color: #606266;
    line-height: 40px;

    -webkit-box-sizing: border-box;
    box-sizing: border-box;
font-weight: bold;
">分辨率</a>
                &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                &lt;!&ndash; <el-select id="DevResolution" @click = "SelectResolution()"  clearable >

                 </el-select>&ndash;&gt;




                <select style="    height: 28px;
    line-height: 28px;width: 150px" id="DevResolution" @click = "SelectResolution()"></select>
                &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                <el-button plain @click = "toOpenCamera">切换设备</el-button>
                &lt;!&ndash; <el-button plain @click = "toCloseCamera">关闭设备</el-button>&ndash;&gt;
                &lt;!&ndash; <input type = "button" value = " 打开设备 " onclick = "toOpenCamera();"/>
                 <input type = "button" value = " 关闭设备 " onclick = "toCloseCamera();"/>&ndash;&gt;
              </div>
              <br />
            </div>

            <br />





          </div>

          <div style="width:15%; height: 150px; border: 1px solid white;  float:left;margin-top: 5px">
            <el-button  @click = "TakePhoto()" style="margin: 40px 75px 75px 75px;color: white;background-color:#5676e9;height: 50px">拍摄</el-button>
          </div>
          <div style="width:15%; height: 500px; border: 5px solid white; float:left ;">
            <a>拍照图片</a>
            <br />
            <img id="CameraPhoto"  src="" style="width: 198px;height: 198px;"  />
            <br />
            <br />
            &lt;!&ndash;<div style="width: 198px;height: 70px;">
              <textarea  style="width:100%; height:100%" id="TextInfo" cols="20" rows="2"></textarea>
            </div>&ndash;&gt;
            <a>消息窗口</a>
            <div style="width: 198px;height: 170px;">
              <el-input
                type="textarea"
                :rows="8"
                style="width:100%; height:100%"
                v-model="textarea"
                id="TextInfo">
              </el-input>
            </div>
          </div>

        </div>
      </template>
      <div slot="footer" class="dialog-footer">
        <el-button type="primary" @click="submitFormpho">确定上传</el-button>
        <el-button @click="cancelphoto">返回</el-button>
      </div>
    </el-dialog>
  -->  </el-card>
  </div>
</template>
<style>
  .ql-toolbar.ql-snow {
    text-align: left;
    border: 1px solid #ccc;
    -webkit-box-sizing: border-box;
    box-sizing: border-box;
    font-family: 'Helvetica Neue', 'Helvetica', 'Arial', sans-serif;
    padding: 8px;
    /* float: none; */
  }
  .el-header, .el-footer {
    background-color: #FFFFFF;
    color: #333;
    text-align: left;
    line-height: 60px;
    font-style: oblique;

  }

  .el-aside {
    background-color: #D3DCE6;
    color: #333;
    text-align: center;
    line-height: 200px;
  }

  .el-main {
    background-color: #FFFFFF;
    color: #333;
    text-align: center;
    line-height: 160px;
  }

  body > .el-container {
    margin-bottom: 40px;
  }

  .el-container:nth-child(5) .el-aside,
  .el-container:nth-child(6) .el-aside {
    line-height: 260px;
  }

  .el-container:nth-child(7) .el-aside {
    line-height: 320px;
  }

  /*对话框标题样式*/
  .el-dialog__title{
    /*color: #1ab394;*/
    font-weight: bold;
    font-size: 25px;
  }
</style>
<script>
  import { listContent,Taphoto, getContent, delContent, addContent, updateContent,getFoldTree } from "@/api/module/gs/thought/thought";
  import watermark from "watermark-dom";
  import {Cam_Close,Cam_ControlInit,Cam_ZoomIn,WebSocketConnect,DeleteFile,Cam_Open,Cam_SetCutMode,Cam_SetFileType,
    Cam_AddMergeImageFile,Cam_ZoomOut,Cam_BestSize,Cam_TrueSize,Cam_RotateLeft,Cam_RotateRight,Cam_SetColorMode,
    SetDpi,SetWaterMark,Cam_SetJpgQuality,Cam_ShowVideoProp,Cam_Photo,Cam_CombinePDF,Cam_AddImgFileToPDF



  } from "@/api/module/gs/gpyhs";
  // import the component
  import Treeselect from '@riophae/vue-treeselect'
  // import the styles
  import '@riophae/vue-treeselect/dist/vue-treeselect.css'
  import gaopai from '../../gs/gaopai/index.vue'
  export default {
    name: "Content",
    dicts:['yh_notice_type','yh_notice_status','think'],
    mounted() {
      watermark.load({ watermark_txt: "  "   });


    },
    components: { Treeselect,gaopai },
    data() {
      return {
        formData: {
          field108: undefined,
          field109: undefined,
          field120: undefined,
          field121: undefined,
          field122: undefined,
          field123: [],
          field124: "水印",
          field125: "100",
          field126: "80",
          field127: 4,
          field128: 0,
          field129: [],
        },
        locfilepath:[] || '',
        locfilepathname:[] || "",
        fileTree: [], //  文件夹目录树
        defaultExpandedKeys: [],
        field108Options: [{
          "id":"Radio1",
          "label": "不裁切",
          "value": "V1"

        }, {
          "label": "手动裁切",
          "value": "V2",
          "id":"Radio2"
        }, {
          "label": "自动裁切",
          "value": "V3",
          "id":"Radio3"
        }, {
          "label": "自定义",
          "value": "V4",
          "id":"Radio4"
        }],
        field109Options: [{
          "label": "jpg",
          "value": 0
        }, {
          "label": "png",
          "value": 1
        }, {
          "label": "tif",
          "value": 2
        }, {
          "label": "pdf",
          "value": 3
        }],
        field120Options: [{
          "label": "彩色",
          "value": 0
        }, {
          "label": "灰度",
          "value": 1
        }, {
          "label": "黑白",
          "value": 2
        }],
        field121Options: [{
          "label": "10",
          "value": 0
        }, {
          "label": "20",
          "value": 1
        }, {
          "label": "30",
          "value": 2
        }, {
          "label": "40",
          "value": 3
        }, {
          "label": "50",
          "value": 4
        }, {
          "label": "60",
          "value": 5
        }, {
          "label": "70",
          "value": 6
        }, {
          "label": "80",
          "value": 7
        }, {
          "label": "90",
          "value": 8
        }, {
          "label": "100",
          "value": 9
        }],
        field122Options: [{
          "label": "100",
          "value": 0
        }, {
          "label": "200",
          "value": 1
        }, {
          "label": "300",
          "value": 2
        }, {
          "label": "400",
          "value": 3
        }, {
          "label": "500",
          "value": 4
        }, {
          "label": "600",
          "value": 5
        }],
        field123Options: [{
          "label": "",
          "value": 0
        }],
        field127Options: [{
          "label": "左上",
          "value": 0
        }, {
          "label": "右上",
          "value": 1
        }, {
          "label": "左下",
          "value": 2
        }, {
          "label": "右下",
          "value": 3
        }, {
          "label": "中间",
          "value": 4
        }],
        field128Options: [{
          "label": "红色",
          "value": 0
        }, {
          "label": "绿色",
          "value": 1
        }, {
          "label": "蓝色",
          "value": 2
        }, {
          "label": "青色",
          "value": 3
        }, {
          "label": "黄色",
          "value": 4
        }, {
          "label": "白色",
          "value": 5
        }, {
          "label": "黑色",
          "value": 6
        }],
        field129Options: [{
          "label": "",
          "value": 0
        }],
        value: '',

        // 遮罩层
        loading: true,
        // 选中数组
        ids: [],
        // 非单个禁用
        single: true,
        // 非多个禁用
        multiple: true,
        // 显示搜索条件
        showSearch: false,
        // 总条数
        total: 0,
        // 内容发布表格数据
        contentList: [],
       tList: [],

        // 弹出层标题
        title: "",
        // 是否显示弹出层
        open: false,
        // define the default value
        value: null,
        // define options
        options: [],
        // 查询参数
        queryParams: {
          pageNum: 1,
          pageSize: 10,
          noticeType: "1",
          contentColumn:null,
          noticeTitle: null,
          noticeContent: null,
          noticeStatus: null,
          pictureUrl: null,
          sourcesUrl: null,
          releaseTime: null,
          participants: null,
          viewsTimes: null,
          createBy: null,
          createTime: null,
          updateBy: null,
          updateTime: null,
          remark: null,
          note1: null,
          note2: null,
          note3: null,
          note4: null,
          note5: null,
          note6: null,
          note7: null,
          note8: null,
          note9: null,
          note10: null
        },
        // 表单参数
        form: {},
        // 拍照
        takephoto:{
          // 是否显示弹出层（用户查询）
          open: false,
          // 弹出层标题（用户查询）
          title: "",
        },
        // 表单校验
        rules: {
          contentColumn: [
            { required: true, message: "栏目不能为空", trigger: "blur" },
          ],
          noticeTitle: [
            { required: true, message: "标题不能为空", trigger: "blur" },
          ],
          noticeContent: [
            { required: true, message: "内容不能为空", trigger: "blur" },
          ],
          releaseTime: [
            { required: true, message: "发布时间不能为空", trigger: "blur" },
          ],
          noticeStatus: [
            { required: true, message: "状态不能为空", trigger: "blur" },
          ],
        }
      };
    },
    created() {
      this.getList();

    },
    methods: {
      indexMethod(index) {
        index = (index + 1) + (this.queryParams.pageNum - 1) * this.queryParams.pageSize
        return index

      },
    /*  initFileTree(id) {
        this.loading = true
        getFoldTree().then((res) => {
          this.loading = false
          if (res.success) {
            this.fileTree = [res.data]
            this.defaultExpandedKeys = id ? [id] : [this.fileTree[0].id]
            console.log(this.fileTree+"999")
          } else {
            this.$message.error(res.message)
          }
        })
      },*/
      //时间格式化显示
      formatDate(time) {
        var date = new Date(time);
        var year = date.getFullYear(),
          month = date.getMonth() + 1,
          day = date.getDate(),
          hour = date.getHours(),
          min = date.getMinutes(),
          sec = date.getSeconds();
        var newTime = year +
          (month < 10 ? '0' + month : month) +
          (day < 10 ? '0' + day : day) +
          (hour < 10 ? '0' + hour : hour) +
          (min < 10 ? '0' + min : min) +
          (sec < 10 ? '0' + sec : sec) ;
        return newTime;
      },


      sleep(milliSeconds) {
        var startTime = new Date().getTime();
        while (new Date().getTime() < startTime + milliSeconds);
      },

      ShowInfo(op) {
        var obj = document.getElementById("TextInfo");
        obj.value = obj.value + "\r\n" + op
      },


      /*----------------------------------------------------
      ---（必须重写该函数）返回获取的设备数目及设备名称  ---
      -----------------------------------------------------*/
      GetDevCountAndNameResultCB(devCount, devNameArr) {

        if (devCount > 0) {

          var obj = document.getElementById("DevName");
          obj.options.length = 0;
          for (var i = 0; i < devCount; i++) {
            var objOption = document.createElement("option");
            objOption.text = devNameArr[i];
            objOption.value = i;
            obj.options.add(objOption);
          }
          obj.selectedIndex = 0;
          var CamID = obj.selectedIndex;

          //获取分辨率
          Cam_GetDevResolution(CamID);

        }
        else {
          ShowInfo("没有发现合适的设备！");
        }
      },

      /*---------------------------------------------------
      ---  （必须重写该函数）返回获取的设备分辨率信息   ---
      ----------------------------------------------------*/
      GetResolutionResultCB(resCount, resArr) {

        if (resCount > 0) {
          var selectIndex = 0;
          var obj = document.getElementById("DevResolution");
          obj.options.length = 0;
          for (var i = 0; i < resCount; i++) {
            var objOption = document.createElement("option");
            objOption.text = resArr[i];
            objOption.value = i;
            obj.options.add(objOption);
            //默认500万分辨率打开
            if (resArr[i] == "2592*1944") {
              selectIndex = i;
            }
          }
          obj.selectedIndex = selectIndex;

          //打开摄像头
          Cam_Close();
          //sleep(100);
          var restr = obj[obj.selectedIndex].text;
          var pos = restr.lastIndexOf("*");
          var width = parseInt(restr.substring(0, pos));
          var height = parseInt(restr.substring(pos + 1, restr.length));
          var CamID = document.getElementById("DevName").selectedIndex;
          Cam_Open(CamID, width, height);
        }
        else {
          ShowInfo("获取分辨率信息失败！");
        }
      },


      /*---------------------------------------------------
      ---     （必须重写该函数）返回摄像头开启状态      ---
      ----------------------------------------------------*/
      GetCameraOnOffStatus(status) {
        if (status == 0) {
          ShowInfo("切换设备成功");
          //Cam_Rotate(1);   // 0-> 0度, 1->90度, 2->180度, 3->270度
        }
        else {
          ShowInfo("切换设备失败!");
        }

      },


//    /*---------------------------------------------------
//    --------     （必须重写该函数）当前拍照状态 ---------
//    ----------------------------------------------------*/
//    function GetCaptrueStatusResultCB(status) {
//        if (status == 0) {
//            ShowInfo("拍照完成");
//        }
//        else {
//            ShowInfo("正在拍摄...");
//        }

//    }


      /*---------------------------------------------------
      --------     （必须重写该函数）拍照结果     ---------
      ----------------------------------------------------*/
      GetCaptrueImgResultCB( flag, path , base64Str) {
        if (flag == 0) {
          var obj = document.getElementById("CameraPhoto");
          obj.src = "data:;base64," + base64Str;
          if (path == "") {
            ShowInfo("拍照成功");
          }
          else {
            ShowInfo("拍照成功，图片保存位置：" + path);
          }
        }
        else {
          ShowInfo("拍照失败!");
        }

      },


      /*---------------------------------------------------
      ------  （必须重写该函数）身份证信息返回结果   ------
      ----------------------------------------------------*/
      GetIdCardInfoResultCB(flag, Name, Sex, Nation, Born, Address, CardNum, IssuedAt, EffectedDate, CardImgPath, CardImgBase64) {
        if (flag == 0) {
          document.getElementById("CardName").value = Name;
          document.getElementById("CardSex").value = Sex;
          document.getElementById("CardNation").value = Nation;
          document.getElementById("CardBorn").value = Born;
          document.getElementById("CardAddress").value = Address;
          document.getElementById("CardNum").value = CardNum;
          document.getElementById("CardIssuedAt").value = IssuedAt;
          document.getElementById("CardEffectDate").value = EffectedDate;
          var obj = document.getElementById("IdCardPhoto");
          obj.src = "data:;base64," + CardImgBase64;
          ShowInfo("读卡成功");
        }
        else {
          ShowInfo("读卡失败!");
        }

      },



      /*-------------------------------------------------------------------
      ------  （必须重写该函数）身份证信息及正反面合并照片返回结果   ------
      --------------------------------------------------------------------*/
      GetIdCardInfoAndImgResultCB(flag, Name, Sex, Nation, Born, Address, CardNum, IssuedAt, EffectedDate, CardImgPath, CardHeadImgBase64, CardImgBase64) {
        if (flag == 0) {
          document.getElementById("CardName").value = Name;
          document.getElementById("CardSex").value = Sex;
          document.getElementById("CardNation").value = Nation;
          document.getElementById("CardBorn").value = Born;
          document.getElementById("CardAddress").value = Address;
          document.getElementById("CardNum").value = CardNum;
          document.getElementById("CardIssuedAt").value = IssuedAt;
          document.getElementById("CardEffectDate").value = EffectedDate;
          var obj = document.getElementById("IdCardPhoto");
          obj.src = "data:;base64," + CardHeadImgBase64;
          var obj = document.getElementById("CameraPhoto");
          obj.src = "data:;base64," + CardImgBase64;
          ShowInfo("读卡成功");
        }
        else {
          ShowInfo("读卡失败!");
        }

      },


      /*---------------------------------------------------
      ------  （必须重写该函数）条码二维码识别返回结果------
      ----------------------------------------------------*/
      QrBarCodeRecogResultCB(flag,codeStr) {
        if (flag == 0)
          ShowInfo("条码/二维码 识别结果:" + codeStr);
        else
          ShowInfo("未识别到内容!");
      },



      /*********************
       ***    初始化操作  ***
       **********************/


      LoadCameraDocument() {

        if (!window.WebSocket) {
          alert("浏览器不支持HTML5,请更新浏览器或者使用其它浏览器1");
        }
        //console.log("LoadCameraDocument");

        const obj = document.getElementById("CameraCtl");
        Cam_ControlInit(obj,0, 0, 600, 400);
      },





      /*********************
       ***    打开摄像头  ***
       **********************/
      toOpenCamera() {
        const CamID = document.getElementById("DevName").selectedIndex;

        const obj = document.getElementById("DevResolution");
        console.log(obj)
        const restr = obj[obj.selectedIndex].text;
        const pos = restr.lastIndexOf("*");
        const width = parseInt(restr.substring(0, pos));
        const height = parseInt(restr.substring(pos + 1, restr.length));
        Cam_Open(CamID, width, height);

      },

      /*********************
       ***    关闭摄像头  ***
       **********************/
      toCloseCamera() {
        Cam_Close();
      },


      /*********************
       ***    切换摄像头  ***
       **********************/
      SelectDevice() {
        var CamID = document.getElementById("DevName").selectedIndex;
        //获取分辨率
        Cam_GetDevResolution(CamID);
      },


      /*********************
       ***    切换分辨率  ***
       **********************/
      SelectResolution() {
        var obj = document.getElementById("DevResolution");
        var restr = obj[obj.selectedIndex].text;
        var pos = restr.lastIndexOf("*");
        var width = parseInt(restr.substring(0, pos));
        var height = parseInt(restr.substring(pos + 1, restr.length));
        var CamID = document.getElementById("DevName").selectedIndex;
        Cam_Open(CamID, width, height);
      },


      /*********************
       ***       拍照     ***
       **********************/
      TakePhoto() {

        var name = this.formatDate(new Date().getTime());

        var obj = document.getElementById("FileType");
        var path;

        Cam_SetFileType(obj.selectedIndex); //设置文件格式
        if (obj.selectedIndex == 0) {
          path = "D:\\" + name + ".jpg";
        }
        else if (obj.selectedIndex == 1) {
          path = "D:\\" + name + ".png";
        }
        else if (obj.selectedIndex == 2) {
          path = "D:\\" + name + ".tif";
        }
        else if (obj.selectedIndex == 3) {
          path = "D:\\" + name + ".pdf";
        }
        else {
          path = "D:\\" + name + ".jpg";
        }
       /* this.locfilepathname=name;
        this.locfilepath=path;*/

        this.locfilepathname="20210090684";
        this.locfilepath="D:\\" + "name" + ".jpg";
        console.log( this.locfilepath+" this.locfilepath")
        Cam_Photo(path);  //主摄像头拍照
        //Cam_Photo("");  //主摄像头拍照

      },


      SetCameraCutMode() {
        console.log(document.getElementById("Radio1").checked+"88")
        //console.log(this.data.field108Options.id+"8")
        console.log(this.formData.field108+"108")
        if (//document.getElementById("Radio1").checked
          this.formData.field108=="V1"
        ) {
          Cam_SetCutMode(0);

        }
        if (//document.getElementById("Radio3").checked
          this.formData.field108=="V3"
        ) {
          Cam_SetCutMode(1);
        }
        if (//document.getElementById("Radio2").checked
          this.formData.field108=="V2"
        ) {
          Cam_SetCutMode(2);
        }
        if (//document.getElementById("Radio4").checked
          this.formData.field108=="V4"
        ) {

          Cam_SetCutMode(3);
          //设置裁剪区域
          //toSleep(100);
          //console.log("SetCustomArea");
          SetCustomArea(3000,3000,9000,9000);
        }
      },


      /*********************
       ***    读取身份证  ***
       **********************/
      GetIdCardInfo() {
        var path = "D:\\IdCard.jpg";
        //Cam_ReadIdCard(path);
        //Cam_ReadIdCard("");
        Cam_ReadIdCardEx(path);
      },


      /*********************
       ***    设置文件格式  ***
       **********************/
      toSetFileType() {
        var obj = document.getElementById("FileType");

        Cam_SetFileType(obj.selectedIndex);
      },


      /*********************
       ***    设置色彩模式  ***
       **********************/
      toSetColorModel() {
        var obj = document.getElementById("ColorMode");

        //Cam_SetColorMode(obj.selectedIndex);
        Cam_SetColorMode(this.formData.field120);
      },


      /*********************
       ***    设置JPG图像质量  ***
       **********************/
      toSetJpgQuality() {
        //var obj = document.getElementById("JpgQuality");


        //var val = parseInt(obj[obj.selectedIndex].text);

        Cam_SetJpgQuality(this.formData.field121);
      },

      /*********************
       ***    设置DPI  ***
       **********************/
      toSetDPI() {
        //var obj = document.getElementById("DPI");
        //var val = parseInt(obj[obj.selectedIndex].text);

        SetDpi(this.formData.field122, this.formData.field122);
      },


      /*********************
       ***    设置去黑边  ***
       **********************/
      toSetDeleteBlackEdge() {
        var obj = document.getElementById("Checkbox1");
        if (obj.checked) {
          Cam_SetDeleteBlackEdge(1);
        }
        else {
          Cam_SetDeleteBlackEdge(0);
        }
      },

      /*********************
       ***    设置去底色  ***
       **********************/
      toSetDeleteBgColor() {
        var obj = document.getElementById("Checkbox2");
        if (obj.checked) {
          Cam_SetDeleteBgColor(1);
        }
        else {
          Cam_SetDeleteBgColor(0);
        }
      },


      /*---------------------------------------------------
      --------     （必须重写该函数）上传结果     ---------
      ----------------------------------------------------*/
      HttpResultCB(flag, ResultStr) {
        if (flag == 0) {
          alert("上传成功 :" + ResultStr);
        }
        else {
          alert("上传失败！");
        }
      },


      /*********************
       ******    上传  ******
       **********************/
      HttpUploadFile() {

        var filePath = "D:\\test.pdf";
        //var url = "http://112.27.213.220:2201/interface/FileUploadCode.jsp";

        //var url = "http://localhost:9005/MyServletTest/upload";
        var url = "http://localhost:4523/UploadFile.ashx";
        //var url = "http://localhost:9005/MyServletTest/upload";
        UploadFile(url, filePath);

      },


//从摄像头中识别二维码
      RecogQrCodeFromCamera(type){
        Cam_RecogQrBarCodeFromCamera(type)
      },

//从图片文件中识别二维码
      RecogBarCodeFromFile(type) {
        var imgpath = "D:\\123.jpg";
        Cam_RecogQrBarCodeFromFile(type, imgpath)
      },




//添加要合并的PDF文件
      ToAddPDFFile() {
//        Cam_AddImgFileToPDF("D:\\111.jpg");
//        sleep(100);
//        Cam_AddImgFileToPDF("D:\\222.jpg");
//        sleep(100);
//        Cam_AddImgFileToPDF("D:\\333.jpg");
//        sleep(100);
//        Cam_AddImgFileToPDF("D:\\444.jpg");
//        sleep(100);
//        Cam_AddImgFileToPDF("D:\\555.jpg");
//        sleep(100);

        //Cam_CombinePDF("D:\\test.pdf");

        Cam_AddImgFileToPDF("");

      },

      /*---------------------------------------------------
      --------     添加合并的PDF文件返回结果     ---------
      ----------------------------------------------------*/
      AddImgFileToPDFResultCB(flag, base64Str)
      {
        if (flag == 0) {
          ShowInfo("添加合并的PDF文件成功");
          var obj = document.getElementById("CameraPhoto");
          obj.src = "data:;base64," + base64Str;
        }
        else {
          ShowInfo("添加合并的PDF文件失败!");
        }
      },


//PDF合并测试
      ToCombinePDF() {

        const name = "D:\\" + this.formatDate(new Date().getTime())+ ".pdf";
        Cam_CombinePDF(name);
        // Cam_CombinePDF("");
      },

      /*---------------------------------------------------
      --------     （必须重写该函数）合并PDF结果     ---------
      ----------------------------------------------------*/
      PdfCombineResultCB(flag, PdfBase64Str) {
        if (flag == 0) {
          ShowInfo("合并PDF完成");
          console.log(PdfBase64Str);
        }
        else {
          ShowInfo("合并PDF失败!");
        }
      },


//添加要合并的图像文件
      ToAddMergeImageFile() {
        Cam_AddMergeImageFile("");
        //sleep(100);
      },
      //放大
      Cam_ZoomIna(){
        Cam_ZoomIn();
      },
      //缩小
      Cam_ZoomOuta(){
        Cam_ZoomOut();
      },
      //适屏
      Cam_BestSizea(){
        Cam_BestSize();
      },
      //1:1
      Cam_TrueSizea(){
        Cam_TrueSize();
      },
      //左旋
      Cam_RotateLefta(){
        Cam_RotateLeft();
      },
      //右旋
      Cam_RotateRighta(){
        Cam_RotateRight();
      },
      //设置
      Cam_ShowVideoPropa(){
        Cam_ShowVideoProp();
      },
      /*---------------------------------------------------
      --------     添加合并图像文件返回结果     ---------
      ----------------------------------------------------*/
      AddMergeImageFileResultCB(flag, base64Str) {
        if (flag == 0) {
          ShowInfo("拍摄成功");
          var obj = document.getElementById("CameraPhoto");
          obj.src = "data:;base64," + base64Str;
        }
        else {
          ShowInfo("添加合并图像文件失败!");
        }
      },


//图像合并测试
      ToMergeImages() {
        Cam_MergeImages("D:\\merge.jpg",0);
      },

      /*---------------------------------------------------
      --------     （必须重写该函数）图像合并结果     ---------
      ----------------------------------------------------*/
      MergeImagesResultCB(flag, base64Str) {
        if (flag == 0) {
          ShowInfo("图像合并完成");
          var obj = document.getElementById("CameraPhoto");
          obj.src = "data:;base64," + base64Str;
        }
        else {
          ShowInfo("图像合并失败!");
        }
      },




      /*---------------------------------------------------
      -------（必须重写该函数）获取驱动盘符返回结果--------
      ----------------------------------------------------*/
      GetDriveResultCB(driveStr) {
        if (driveStr == "") {
          ShowInfo("获取盘符失败!");
        }
        else {
          ShowInfo(driveStr);
        }
      },


//设置水印
      toSetWaterMarkParams() {
        var isAddMark;
        var isAddTime;
        var wTransp;
        var wPos;
        var wSize;
        var wColor;
        var szInfo;
        var obj = document.getElementById("Checkbox3");
        console.log(this.formData.field123+"888989")
        if (this.formData.field123=="0"){
          isAddMark = 1;
        }

        else{
          isAddMark = 0;
        }

        obj = document.getElementById("Checkbox4");
        if (this.formData.field129=="0")
          isAddTime = 1;
        else
          isAddTime = 0;
        //szInfo = document.getElementById("Text1").value;   //水印内容
        szInfo=this.formData.field124;
        console.log(this.formData.field124+"855")
        //wTransp = parseInt(document.getElementById("Text2").value); //透明度
        wTransp = parseInt(this.formData.field125);
        console.log(wTransp+"866")
        // wSize = parseInt(document.getElementById("Text3").value);   //水印大小
        wSize= parseInt(this.formData.field126);
        // wPos = document.getElementById("Select1").selectedIndex;   //水印位置
        wPos=this.formData.field127;
//  wColor = document.getElementById("Select2").selectedIndex;   //水印颜色
        wColor=this.formData.field128;
        SetWaterMark(isAddMark, 0, isAddTime, wTransp, wPos, wSize, wColor, szInfo);  //生效水印设置
      },



//删除文件
      ToDeleteFile() {
        //  var path = this.data.locfilepath;
        const path =   this.locfilepath;
        console.log( this.locfilepath+"path")
        DeleteFile(path);
      },

//删除文件返回结果
      GetDeleteFileResultCB(flag) {
        if (flag == 0) {
          ShowInfo("删除文件成功");
        }
        else {
          ShowInfo("删除文件失败！");
        }
      },




      /** 查询内容发布列表 */
      getList() {
        this.loading = true;

        listContent(this.queryParams).then(response => {

          this.contentList = response.rows;
          this.total = response.total;
          this.loading = false;
        });
      },/** huoqu操作 */
     /* huoqu() {
        this.loading = true;

        pop().then(response => {
          console.log(this.data+"81")
          this.tList = response.rows;
          console.log(response.rows+"8")
          console.log(this.rows.data+"80")

          this.total = response.total;
          this.loading = false;
        });
      },*/
      // 取消按钮
      cancel() {
        this.open = false;
        this.reset();
      },
      // 取消按钮
      cancelphoto() {
        this.takephoto.open = false;
        this.reset();
      },
      // 表单重置
      reset() {
        this.form = {
          id: null,
          noticeType: "1",
          noticeTitle: null,
          contentColumn:null,
          noticeContent: null,
          noticeStatus: null,
          pictureUrl: null,
          sourcesUrl: null,
          releaseTime: null,
          participants: null,
          viewsTimes: null,
          createBy: null,
          createTime: null,
          updateBy: null,
          updateTime: null,
          remark: null,
          note1: null,
          note2: null,
          note3: null,
          note4: null,
          note5: null,
          note6: null,
          note7: null,
          note8: null,
          note9: null,
          note10: null
        };
        this.resetForm("form");
      },
      /** 搜索按钮操作 */
      handleQuery() {
        this.queryParams.pageNum = 1;
        this.getList();
      },
      handleTree() {
        this.queryParams.pageNum = 1;
        this.huoqu();
      },
      /** 重置按钮操作 */
      resetQuery() {
        this.resetForm("queryForm");
        this.handleQuery();
      },
      // 多选框选中数据
      handleSelectionChange(selection) {
        this.ids = selection.map(item => item.id)
        this.i = selection.map(item => item.noticeTitle)
        this.single = selection.length!==1
        this.multiple = !selection.length
      },
      /** 新增按钮操作 */
      handleAdd() {
        this.reset();
        this.open = true;
        this.title = "思想政治";
        //this.$tab.openPage("用户管理","/monitor/online");
      },
      /** 修改按钮操作 */
      handleUpdate(row) {
        this.reset();
        const id = row.id || this.ids
        getContent(id).then(response => {
          this.form = response.data;
          this.open = true;
          this.title = "修改思想政治";
        });
      },
      /** 拍照按钮操作 */
      takePhotop() {
        this.reset();



        this.takephoto.open = true;

        this.takephoto.title = "高拍仪";
        this.LoadCameraDocument();
        //this.$tab.openPage("用户管理","/monitor/online");
      },
      /** 提交按钮 */
      submitFormpho() {

          /*filePathp: this.locfilepath,
          fileName:this.locfilepath*/
        // filePatha= "8989";
        /*let filePatha =this.locfilepath
        let fileName='小红'*/
        let query = {
          filePatha: this.locfilepath,
          fileName:'小红'
        }

        Taphoto(query).then(response => {
                this.$modal.msgSuccess("上传成功");
                this.open = false;
                this.getList();
              });



      },
      /** 提交按钮 */
      submitForm() {
        this.$refs["form"].validate(valid => {
          if (valid) {
            if (this.form.id != null) {
              this.form.noticeContent=this.form.noticeContent.slice(3,-4)
              updateContent(this.form).then(response => {
                this.$modal.msgSuccess("修改成功");
                this.open = false;
                this.getList();
              });
            } else {
              this.form.noticeContent=this.form.noticeContent.slice(3,-4)
              addContent(this.form).then(response => {
                this.$modal.msgSuccess("新增成功");
                this.open = false;
                this.getList();
              });
            }
          }
        });
      },
      /** 详情操作 */
      handlelook(row) {
        const id = row.id;
        // const tableName = row.tableName || this.tableNames[0];
        const params = {pageNum: this.queryParams.pageNum};

        this.$router.push({path: "/dangzheng/indexxiangqing", query: {id}});
      },
      /** 删除按钮操作 */
      handleDelete(row) {
        const ids = row.id || this.ids;
        const i = row.noticeTitle || this.i;
        this.$modal.confirm('是否确认删除标题为"' + i + '"的数据项？').then(function() {
          return delContent(ids);
        }).then(() => {
          this.getList();
          this.$modal.msgSuccess("删除成功");
        }).catch(() => {});
      },
      /** 导出按钮操作 */
      handleExport() {
        this.download('gs/thought/export', {
          ...this.queryParams
        }, `content_${new Date().getTime()}.xlsx`)
      }
    }
  };
</script>
